// ChildFrm.cpp : implementation of the CChildFrame class
//

#include "stdafx.h"
#include "ProteinVista.h"

#include "ChildFrm.h"
#include "ProteinVistaDoc.h"
#include "ProteinVistaView.h"
#include "ProteinVistaRenderer.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CChildFrame

IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)

BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
	//{{AFX_MSG_MAP(CChildFrame)
	ON_WM_CREATE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction

CChildFrame::CChildFrame()
{
	
	
}

CChildFrame::~CChildFrame()
{
}

BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
	// Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	if( !CMDIChildWnd::PreCreateWindow(cs) )
		return FALSE;

	return TRUE;
}

/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics

#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
	CMDIChildWnd::AssertValid();
}

void CChildFrame::Dump(CDumpContext& dc) const
{
	CMDIChildWnd::Dump(dc);
}

#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
LRESULT CChildFrame::DefWindowProc(UINT32 message, WPARAM wParam, LPARAM lParam) 
{
	// Add your specialized code here and/or call the base class
	LRESULT result = CMDIChildWnd::DefWindowProc(message, wParam, lParam);

	switch(message)
	{
        case WM_GETMINMAXINFO:
        case WM_ENTERSIZEMOVE:
        case WM_SIZE:
        case WM_EXITSIZEMOVE:
		{
			CProteinVistaView * pProteinVistaView = (CProteinVistaView*)GetActiveView();
			if ( pProteinVistaView )
			{
				pProteinVistaView->PostMessage(message, wParam, lParam);
			}
			break;
		}
	}
		
	return result;
}

int CChildFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
		return -1;

	CMenu* pMenu = GetSystemMenu(FALSE);

	pMenu->RemoveMenu(SC_RESTORE, MF_BYCOMMAND);
	pMenu->RemoveMenu(SC_MINIMIZE, MF_BYCOMMAND);
	pMenu->RemoveMenu(SC_MAXIMIZE, MF_BYCOMMAND);
	pMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
	pMenu->RemoveMenu(SC_SIZE, MF_BYCOMMAND);

	return 0;
}

